package com.lf.util;

import java.text.SimpleDateFormat;
import java.util.*;

public class Util {

	private static final Random RANDOM = new Random();

	public static final String getSixRandom() {
		Random random = new Random();
		String sixRandom = random.nextInt(1000000) + "";
		int randLength = sixRandom.length();
		if (randLength < 6) {
			for (int i = 1; i <= 6 - randLength; i++)
				sixRandom = "0" + sixRandom;
		}
		return sixRandom;
	}

	public static final String UUID() {
		UUID uuid = UUID.randomUUID();
		return uuid.toString().replaceAll("-", "").toUpperCase();
	}

	public static final String getTime() {
		return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
	}

	public static String getOrderCode() {
		String code = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
		Integer s = RANDOM.nextInt(999) % (999 - 100 + 1) + 100;
		return code + s;
	}

	public static Map<String, Object> initMap() {
		return new HashMap<String, Object>();
	}

}
